package network

import (
	"time"
)

type Config struct {
	HTTPPort          string        `mapstructure:"http_port"`
	RPCPort           string        `mapstructure:"rpc_port"`
	PerfPort          string        `mapstructure:"perf_port"`
	ReadTimeout       time.Duration `mapstructure:"read_timeout"`
	WriteTimeout      time.Duration `mapstructure:"write_timeout"`
	ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"`
	IdleTimeout       time.Duration `mapstructure:"idle_timeout"`
	RPCTimeout        time.Duration `mapstructure:"rpc_timeout"`
	MaxLifeTime       time.Duration `mapstructure:"max_life_time"`
	ForceCloseWait    time.Duration `mapstructure:"force_close_wait"`
	KeepAliveInterval time.Duration `mapstructure:"keep_alive_interval"`
}

func (c *Config) CheckDefault() {
	if c.PerfPort == "" {
		c.PerfPort = "2333"
	}
}
